package org.jeecg.modules.quartz.job;

import com.google.common.base.Stopwatch;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.settlement.service.AdminSettlementService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * @author guoyh
 * @ClassName OrderConfirmJob
 * @Description
 * @since 2020/9/3 23:44
 **/
@Slf4j
public class OrderConfirmJob implements Job {

    @Resource
    private AdminSettlementService adminSettlementService;


    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("订单确认job开始");
        Stopwatch stopwatch = Stopwatch.createStarted();
        adminSettlementService.confirmOrder();
        log.info("订单确认job结束,耗时：{}毫秒",stopwatch.elapsed(TimeUnit.MILLISECONDS));
    }
}
